package com.cym.controller;

import com.cym.entity.ProductTypes;
import com.cym.service.ProductTypesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/productTypes")
@CrossOrigin //允许跨域访问
public class ProductTypesController {
    @Autowired
    ProductTypesService productTypesService;

    @RequestMapping("/getAllProductTypes")
    public List<ProductTypes> getAllProductTypes() {
        return productTypesService.getAllProductTypes();
    }
}
